module Customers(CustomersDB, CustomerItem, newCustomer, newClient, isEmptyCDB, emptyCDB) where

import Customer
import CustomerServices


newtype CustomersDB = CDB [CustomerItem]


-- pensar en tener un modulo que sea la unica interfaz con elsistema

-- asks to a CustomersDB if it is empty
isEmptyCDB :: CustomersDB -> Bool
isEmptyCDB (CDB []) = True
isEmptyCDB _ = False

emptyCDB :: CustomersDB
emptyCDB = CDB []

-- adds a new customer to the data base
newClient :: CustomerItem -> CustomersDB -> CustomersDB
newClient ct (CDB cts) = CDB (ct :cts)



